﻿namespace Kaleida.ServiceMonitor.Model
{
    public static class StringUIExtensions
    {
        public static string Abbreviate(this string text, int maxLength, string abbreviationText = "...")
        {
            return text.Length > maxLength ? text.Substring(0, maxLength - abbreviationText.Length) + abbreviationText : text;
        }

        public static string ToBallotBox(this bool value)
        {
            return (value ? "☑" : "☐");
        }
    }
}
